/* GET users listing. */
/**
 * users路由器
 * @param app
 */
var User = require('../model/User');

module.exports = function(app){

  app.get('/users/:name', function(req, res){
    var name = req.params.name;    // params -> /users/andy, query -> /users?name=andy, body -> (post)
    console.log('-------------' + name);
    User.get(name, function(err, user) {
      res.render('users', {user: user});
    });
    ////res.send("respond with a resource");
    //User.get(name, function(err, user) {
    //  console.log(user);
    //});
  });

};
